package org.example.zsfmybatis.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.zsfmybatis.model.Meals;

@Mapper
public interface MealsMapper extends BaseMapper<Meals> {
    @Select("select * from meals where meals_id=#{id}")
    Meals getMealsById(String id);
    @Update("update meals set sum=sum-#{sum} where meals_id=#{id}")
    void updateMealsById(String id,int sum);
}
